<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改订单列表')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-orderInfo-edit" th:object="${tOrderInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户id：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">通道编码：</label>
                <div class="col-sm-8">
                    <input name="channel" th:field="*{channel}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">支付通道账号：</label>
                <div class="col-sm-8">
                    <input name="channelAccount" th:field="*{channelAccount}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">平台收款账户ID：</label>
                <div class="col-sm-8">
                    <input name="recipientId" th:field="*{recipientId}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">支付宝authcode：</label>
                <div class="col-sm-8">
                    <input name="aliAuthCode" th:field="*{aliAuthCode}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">经度：</label>
                <div class="col-sm-8">
                    <input name="longitude" th:field="*{longitude}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">维度：</label>
                <div class="col-sm-8">
                    <input name="latitude" th:field="*{latitude}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">付款者支付宝ID：</label>
                <div class="col-sm-8">
                    <input name="aliUserId" th:field="*{aliUserId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">收款号所有者的uid：</label>
                <div class="col-sm-8">
                    <input name="recipientUid" th:field="*{recipientUid}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">收款号实名：</label>
                <div class="col-sm-8">
                    <input name="recipientRealName" th:field="*{recipientRealName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单金额：</label>
                <div class="col-sm-8">
                    <input name="money" th:field="*{money}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">用户实际支付金额。单位分：</label>
                <div class="col-sm-8">
                    <input name="realMoney" th:field="*{realMoney}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">到账金额。单位分：</label>
                <div class="col-sm-8">
                    <input name="receiptMoney" th:field="*{receiptMoney}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">商户自己的唯一订单号：</label>
                <div class="col-sm-8">
                    <input name="outTradeNo" th:field="*{outTradeNo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户下单传的附加信息。：</label>
                <div class="col-sm-8">
                    <input name="outBody" th:field="*{outBody}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商户自己用户的id：</label>
                <div class="col-sm-8">
                    <input name="outUserId" th:field="*{outUserId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">商品名称：</label>
                <div class="col-sm-8">
                    <input name="goodsName" th:field="*{goodsName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付成功异步通知地址：</label>
                <div class="col-sm-8">
                    <textarea name="notifyUrl" class="form-control" required>[[*{notifyUrl}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">支付成功后跳转的商户url：</label>
                <div class="col-sm-8">
                    <textarea name="returnUrl" class="form-control" required>[[*{returnUrl}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付二维码文本：</label>
                <div class="col-sm-8">
                    <textarea name="qrcodeTxt" class="form-control">[[*{qrcodeTxt}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">二维码图片真正内容：</label>
                <div class="col-sm-8">
                    <input type="hidden" class="form-control" th:field="*{qrcodeContent}">
                    <div class="summernote" id="qrcodeContent"></div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付二维码图片地址：</label>
                <div class="col-sm-8">
                    <textarea name="qrcodeUrl" class="form-control">[[*{qrcodeUrl}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">支付地址：</label>
                <div class="col-sm-8">
                    <textarea name="payUrl" class="form-control">[[*{payUrl}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">二维码生成时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="qrcodeTime" th:value="${#dates.format(tOrderInfo.qrcodeTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否支付成功：</label>
                <div class="col-sm-8">
                    <input name="paySucc" th:field="*{paySucc}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">支付成功时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="paySuccTime" th:value="${#dates.format(tOrderInfo.paySuccTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">三方支付通道订单id：</label>
                <div class="col-sm-8">
                    <input name="pay3rdOrderNo" th:field="*{pay3rdOrderNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">回调通知是否成功：</label>
                <div class="col-sm-8">
                    <input name="notifySucc" th:field="*{notifySucc}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">回调成功通知时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="notifySuccTime" th:value="${#dates.format(tOrderInfo.notifySuccTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">平台收取的费用。单位分：</label>
                <div class="col-sm-8">
                    <input name="platformFee" th:field="*{platformFee}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单有效时间。超过该时间订单无效：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="validTime" th:value="${#dates.format(tOrderInfo.validTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">订单请求ip：</label>
                <div class="col-sm-8">
                    <input name="orderIp" th:field="*{orderIp}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">通道支付结果消息：</label>
                <div class="col-sm-8">
                    <input name="channelPayResult" th:field="*{channelPayResult}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">是否人工补单。默认0否：</label>
                <div class="col-sm-8">
                    <input name="manualSucc" th:field="*{manualSucc}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最近访问支付地址的ip：</label>
                <div class="col-sm-8">
                    <input name="payurlLastseeIp" th:field="*{payurlLastseeIp}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生成付款二维码是否需要设置备注。：</label>
                <div class="col-sm-8">
                    <input name="needSetMark" th:field="*{needSetMark}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">下游订单号：</label>
                <div class="col-sm-8">
                    <input name="customOrderNo" th:field="*{customOrderNo}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">京东买手号：</label>
                <div class="col-sm-8">
                    <input name="jdBuyerId" th:field="*{jdBuyerId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">通道费率：</label>
                <div class="col-sm-8">
                    <input name="channelRate" th:field="*{channelRate}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="bankName" th:field="*{bankName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="proxyIp" th:field="*{proxyIp}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="createUser" th:field="*{createUser}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">：</label>
                <div class="col-sm-8">
                    <input name="updateUser" th:field="*{updateUser}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: summernote-js" />
    <script th:inline="javascript">
        var prefix = ctx + "business/orderInfo";
        $("#form-orderInfo-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-orderInfo-edit').serialize());
            }
        }

        $("input[name='qrcodeTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='paySuccTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='notifySuccTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='validTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(function() {
            $('.summernote').each(function(i) {
                $('#' + this.id).summernote({
                    lang: 'zh-CN',
                    dialogsInBody: true,
                    callbacks: {
                        onChange: function(contents, $edittable) {
                            $("input[name='" + this.id + "']").val(contents);
                        },
                        onImageUpload: function(files) {
                            var obj = this;
                            var data = new FormData();
                            data.append("file", files[0]);
                            $.ajax({
                                type: "post",
                                url: ctx + "common/upload",
                                data: data,
                                cache: false,
                                contentType: false,
                                processData: false,
                                dataType: 'json',
                                success: function(result) {
                                    if (result.code == web_status.SUCCESS) {
                                        $('#' + obj.id).summernote('insertImage', result.url);
                                    } else {
                                        $.modal.alertError(result.msg);
                                    }
                                },
                                error: function(error) {
                                    $.modal.alertWarning("图片上传失败。");
                                }
                            });
                        }
                    }
                });
                var content = $("input[name='" + this.id + "']").val();
                $('#' + this.id).summernote('code', content);
            })
        });
    </script>
</body>
</html>